package com.wyix.device;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

/**
 * @author wangdx
 * @since 2025/8/19
 */
@Service
public class LEDLight implements Light {
    private final String color;
    private final int brightness;

    public LEDLight(@Value("${smart.home.light.color}")String color, @Value("${smart.home.light.brightness}")int brightness) {
        this.color = color;
        this.brightness = brightness;
    }

    @Override
    public String turnOn() {
        return String.format("LED灯已开启 [颜色: %s, 亮度: %d%%]", color, brightness);
    }

    @Override
    public String turnOff() {
        return "LED灯已关闭";
    }

    @Override
    public String getType() {
        return "LED";
    }
}
